package com.xneure.enging.widget.impl;

import com.xneure.enging.ui.element.UiCheckBox;
import com.xneure.enging.widget.Control;
import com.xneure.enging.widget.Widget;
import com.xneure.utils.ObjectUtil;

public class CheckBox extends Input<UiCheckBox> {
	private boolean checked = false;
	public CheckBox(Control parent) {
		super(parent);
		setStyle("vertical-align", "middle");
	}
	public void setText(String text){
	}
	@Override
	protected Widget<UiCheckBox> onEvent(Object src) {
		if(ObjectUtil.isNotNull(src)){
			checked = Boolean.parseBoolean(src.toString());
		}
		return super.onEvent(src);
	}
	public boolean isChecked() {
		return checked;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	
}
